<div class="groups view">
    <h2><?php __('Grupos de Acesso de Usuários'); ?></h2>
    <dl><?php $i = 0;
$class = ' class="altrow"'; ?>
        <dt<?php if ($i % 2 == 0)
            echo $class; ?>><?php __('Id'); ?></dt>
        <dd<?php if ($i++ % 2 == 0)
                echo $class; ?>>
                <?php echo $group['Group']['id']; ?>
            &nbsp;
        </dd>
        <dt<?php if ($i % 2 == 0)
                    echo $class; ?>><?php __('Nome'); ?></dt>
            <dd<?php if ($i++ % 2 == 0)
                    echo $class; ?>>
                <?php echo $group['Group']['name']; ?>
            &nbsp;
        </dd>
    </dl>
</div>
<div class="actions">
    <ul>
        <li><?php echo $html->link(__('Editar Grupo', true), array('action' => 'edit', $group['Group']['id'])); ?> </li>
        <li><?php echo $html->link(__('Excluir Grupo', true), array('action' => 'delete', $group['Group']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $group['Group']['id'])); ?> </li>
        <li><?php echo $html->link(__('Listar Grupos', true), array('action' => 'index')); ?> </li>
        <li><?php echo $html->link(__('Adicionar Grupo', true), array('action' => 'add')); ?> </li>
        <li><?php echo $html->link(__('Listar Usuários', true), array('controller' => 'users', 'action' => 'index')); ?> </li>
    </ul>
</div>
<div class="related">
    <h3><?php __('Related Users'); ?></h3>
    <?php if (!empty($group['User'])): ?>
                    <table cellpadding = "0" cellspacing = "0">
                        <tr>
                            <th><?php __('Id'); ?></th>
                            <th><?php __('Nome de Usuário'); ?></th>
                            <th class="actions"><?php __('Ações'); ?></th>
                        </tr>
        <?php
                    $i = 0;
                    foreach ($group['User'] as $user):
                        $class = null;
                        if ($i++ % 2 == 0) {
                            $class = ' class="altrow"';
                        }
        ?>
                        <tr<?php echo $class; ?>>
                            <td><?php echo $user['id']; ?></td>
                            <td><?php echo $user['username']; ?></td>
                            <td class="actions">
                <?php echo $html->link(__('Ver', true), array('controller' => 'users', 'action' => 'view', $user['id'])); ?>
                <?php echo $html->link(__('Editar', true), array('controller' => 'users', 'action' => 'edit', $user['id'])); ?>
                <?php echo $html->link(__('Excluir', true), array('controller' => 'users', 'action' => 'delete', $user['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $user['id'])); ?>
                    </td>
                </tr>
        <?php endforeach; ?>
                    </table>
    <?php endif; ?>

                        <div class="actions">
                            <ul>
                                <li><?php echo $html->link(__('Adicionar Usuário', true), array('controller' => 'users', 'action' => 'add')); ?> </li>
        </ul>
    </div>
</div>
